package com.dhcc.model;

import javax.persistence.*;

/**
 * Created by guorui on 2017/3/17.
 */
@Entity
@Table(name = "tb_teacher", schema = "test", catalog = "")
public class Teacher {
    private int teaId;
    private int userId;
    private String teaName;
    private String teaSex;
    private String teaCompany;
    private String teaPhone;
    private String teaEmail;

    @Id
    @Column(name = "tea_id", nullable = false)
    public int getTeaId() {
        return teaId;
    }

    public void setTeaId(int teaId) {
        this.teaId = teaId;
    }

    @Basic
    @Column(name = "user_id", nullable = false)
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "tea_name", nullable = false, length = 8)
    public String getTeaName() {
        return teaName;
    }

    public void setTeaName(String teaName) {
        this.teaName = teaName;
    }

    @Basic
    @Column(name = "tea_sex", nullable = false, length = 2)
    public String getTeaSex() {
        return teaSex;
    }

    public void setTeaSex(String teaSex) {
        this.teaSex = teaSex;
    }

    @Basic
    @Column(name = "tea_company", nullable = false, length = 30)
    public String getTeaCompany() {
        return teaCompany;
    }

    public void setTeaCompany(String teaCompany) {
        this.teaCompany = teaCompany;
    }

    @Basic
    @Column(name = "tea_phone", nullable = false, length = 20)
    public String getTeaPhone() {
        return teaPhone;
    }

    public void setTeaPhone(String teaPhone) {
        this.teaPhone = teaPhone;
    }

    @Basic
    @Column(name = "tea_email", nullable = false, length = 50)
    public String getTeaEmail() {
        return teaEmail;
    }

    public void setTeaEmail(String teaEmail) {
        this.teaEmail = teaEmail;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Teacher teacher = (Teacher) o;

        if (teaId != teacher.teaId) return false;
        if (userId != teacher.userId) return false;
        if (teaName != null ? !teaName.equals(teacher.teaName) : teacher.teaName != null) return false;
        if (teaSex != null ? !teaSex.equals(teacher.teaSex) : teacher.teaSex != null) return false;
        if (teaCompany != null ? !teaCompany.equals(teacher.teaCompany) : teacher.teaCompany != null) return false;
        if (teaPhone != null ? !teaPhone.equals(teacher.teaPhone) : teacher.teaPhone != null) return false;
        if (teaEmail != null ? !teaEmail.equals(teacher.teaEmail) : teacher.teaEmail != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = teaId;
        result = 31 * result + userId;
        result = 31 * result + (teaName != null ? teaName.hashCode() : 0);
        result = 31 * result + (teaSex != null ? teaSex.hashCode() : 0);
        result = 31 * result + (teaCompany != null ? teaCompany.hashCode() : 0);
        result = 31 * result + (teaPhone != null ? teaPhone.hashCode() : 0);
        result = 31 * result + (teaEmail != null ? teaEmail.hashCode() : 0);
        return result;
    }
}
